﻿@{
    ViewBag.Title = "Guestbook";
    Layout = "~/Views/Shared/_LayoutMember.cshtml";
}
@model Domain.Model.Guestbook

@section HeadScript
{
    <link href="~/Content/window/window.css" rel="stylesheet" />
    <script src="~/Content/window/window.js"></script>
    <link href="~/Content/validBox/validBox.css" rel="stylesheet" />
    <script src="~/Content/validBox/validBox.js"></script>
}
<div class="fr2 green fs-25 Tbrline">留言反馈</div>
<div class="fr2">
    <form class="form-horizontal">
        <div class="control-group">
            <label class="control-label" for="Name">标题</label>
            <div class="controls">
                @Html.TextBoxFor(i => i.Title, Html.ValidFor(i => i.Title))
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="Name">内容</label>
            <div class="controls">
                @Html.TextAreaFor(i => i.Contect, Html.ValidFor(i => i.Contect))
            </div>
        </div>
        <div class="ui-row ui-row-sbtn">
            <input type="button" value="提 交" class="sbtn" onclick="saveForm()" />
        </div>
    </form>
</div>

@section Script
{
    <script type="text/javascript">
        function saveForm() {
            $("form").validBox(function (r) {
                if (!r) return;
                $.post("/Member/Guestbook/", $("form").serialize(), function (data) {
                    if (data.state) {
                        window.messageBox("提示", "保存成功！");
                        $("#Title").val("");
                        $("#Contect").val("");
                    }
                    else {
                        window.messageBox("提示", data.value);
                    }
                });
            })
        }
    </script>
}
